Moire ScreenSaver (portions ⌐1987 John Lim) is a program that is installed via a cdev file that can be accessed from the Control Panel. After Moire (pronounced mwahr) ScreenSaver is installed, when the Mac is left inactive the screen will be darkened (to prevent the screen image from burning into the phosphor of the CRT) and a pretty Moire pattern will appear. To turn off the screensaver when it is activated, move your mouse. While the Moire pattern is moving, press a few keys to see some special effects╔
Installation
------------
To run it, place the Moire cdev file in the System Folder and open it using the Control Panel (use the Control Panel found in System 4.0 or later). Opening the cdev will automatically install the screensaver in memory if it has not yet been installed. ( A ╘cdev╒ is a file that the Control Panel can access).
Alternately you may leave the cdev file in your System Folder so that every time you bootup Moire ScreenSaver will install itself. During installation on bootup, the Moire icon will appear at the bottom-left of your screen. If you don╒t want Moire to be installed hold down the Shift-Key until the desktop appears on the screen. Any errors during installation are indicated by beeps.
This program will work on any Macintosh with 128K+ Roms. Any System from 3.2 onwards can be used, subject to the following provisos :
Ñ System 3.2 : You must either, (a) copy the INIT 31 resource from a System greater than 4.0 to your 3.2 System or (b) change the Moire cdev file type from cdev to INIT, and then place Moire cdev in the System Folder and reboot.
Ñ System earlier than 4.1 : You may not change the Permanent Settings from the Control Panel as it needs to use the new routine PopupMenuSelect(). Instead, the Mac will beep when you click the the Change Settings box.
Configuring Moire ScreenSaver
-----------------------------
If you access the program from the Control Panel with System 4.1 or greater, you may configure the following settings - shape, speed, and length. Click in the dashed-frame box that says ╥Click Here To Change Settings╙. A hierachical pop-up menu will appear that will allow you to choose how the Moire pattern appears. These settings come into affect everytime you bootup and whenever you access the Moire cdev from the Control Panel.
The settings are :
Ñ Shape allows you to set the initial shape that appears on bootup.
Ñ Speed sets the variability of the movement. 1 means that the movement is extremely stately. 0 means that the lines will swing wildly about.
Ñ Length sets the number of lines used in the pattern.
If you have background tasks, the speed and length settings will not affect the speed of the background tasks, even if the speed is set to 0 and length to 100 lines. However, some shapes, like the oval, are computationally more expensive than others.
Features
--------
When Moire ScreenSaver is installed the screensaver will activate itself when there has been no user activity for 4 minutes. The length of time before Moire ScreenSaver activates itself can be configured from the Control Panel. The new setting is put into effect when the Control Panel is closed or another cdev is selected from the Control Panel. This setting is also saved in the Moire cdev file if the disk is not locked; so the next time you boot up, the new setting will be used.
I use the AutoBlack protocol for controlling darkening the screen as AutoBlack is so widely used. This means that if you place the cursor in the top-right corner the screensaver will automatically be activated, and if the cursor is put in the bottom-right corner the screensaver will be disabled for as long as you keep the cursor in that corner.
While the screen is darkened, a Moire pattern will appear. Try typing these keys while the pattern is active :
'[' and ']' shorten and lengthen the moire queue.
'q' toggles speed quantization.
'1'-'9'-'0' set a speed limit for points (1 = slow to 0 = fast)
Other keys change the pattern╒s shape:
'r' - rectangle (default for unassigned keys)
'o' - oval
'd' - diamond
't' - triangle
'p' - pentagram (for satanic users)
'h' - hourglass
'v' - a vee
'x' - an ex
'+' - a cross
'/' & '\' - slanted lines
' ' - hit spacebar for help.
Expert users may modify the initial shape used. Open the cdev using ResEdit and look for a 'Cfig' resource. The 6th byte of 'Cfig' will contain the default shape that is initially used when you boot up.
You may also disable the Moire ScreenSaver temporarily from the Control Panel. This disables it as long as the Macintosh is left on, or until you open the cdev again from the control panel.
Why should you use this ScreenSaver ?
-------------------------------------
There already exist at least two other well-known screensavers, AutoBlack and Pyro!¬.
AutoBlack is excellent in my opinion as it is very transparent to the user, but it takes up a lot of memory (at least 22K) and also it steals some cpu cycles - that is it ╥might╙ slow down your computer during cpu intensive tasks. For example if you are compressing a large file, AutoBlack will activate itself if you shift the cursor to the top-right corner, slowing down the compression process. Moire ScreenSaver might darken the screen, but it will probably not draw the moire pattern on the screen - thus saving cpu cycles. Similarly during i/o intensive tasks like reading/writing to disks, Moire will not use the processor as extensively as AutoBlack (though this isn╒t so important).
Pyro!¬ is nice, but it disables any foreground tasks that the application is currently running. For example, if you are using a terminal emulation program while you are logged onto Compuserve and receiving a TEXT file, Pyro!¬ will refuse to turn itself on.This is NOT application-friendly in my opinion. Conversely, Moire ScreenSaver enables foreground tasks because it only draws the Moire pattern whenever the foreground application calls SystemTask().
Theory of Operation
-------------------
This program polls GetNextEvent(). If the mouse is in the special corners, the appropriate tasks are carried out. If we have been receiving nullEvents for a preset number of minutes,a new window the size of the screen created and painted black. Then whenever SystemTask() is called the moire pattern is drawn on the new window.
If the screen is painted black but no pattern is drawn, it probably means that the application calls GetNextEvent() but doesn╒t call SystemTask(). If nothing happens when you move the mouse to the top-right corner, it means that the WindowManager is not initialized or the application is not calling GetNextEvent() - this probably implies that the Mac is doing something cpu-intensive, so the screensaver should not be activated anyway. If the moire movements are jerky (as in Multi-Finder on a Mac+) it is because SystemTask() is called infrequently by the application.
Under Switcher the Hibernation flag is set when the screensaver is activated. This means that Switcher background tasks are disabled. This is necessary as otherwise conflicts can occur between the current active application╒s process and the screensaver╒s task.
Note that because the screensaver uses the Window Manager, it is the application╒s responsibility to save and restore the screen; so if a program does not properly save the screen when the screensaver is ever activated, make sure you keep the cursor in the bottom-right corner !
Big Screens
-----------
This screensaver should work with big screens. However Stepping-Out¬ poses a problem because it dynamically modifies the screen-size. Therefore the program always checks the screen-size whenever the Moire cdev is accessed via the Control Panel and just before the Moire ScreenSaver is activated.
This means if Moire ScreenSaver is misbehaving because of a change in screen-size, just open the Moire cdev again from the Control Panel.
MultiFinder
-----------
MultiFinder currently implements background tasking using 2 methods. Most applications today support the first method, in which background tasks are performed when GetNextEvent() is invoked. The second method, which is new, uses the new System Trap WaitNextEvent(). Most applications do not support the second method, but as time goes by, more and more programs will.
Moire ScreenSaver works well for programs that use the first method. However, Moire ScreenSaver will not work if programs use the second method. (This is because there appears to be no way to patch WaitNextEvent() easily).
Opening the Control Panel from Multi-Finder will not install Moire ScreenSaver either. This is because Multi-Finder refuses to allow Moire ScreenSaver to patch the ROM routine GetNextEvent(). You must run Moire ScreenSaver during boot-up or before you launch Multi-Finder.
I have not tested this program extensively under Multi-Finder as I cannot run Multi-Finder efficiently on my present hardware configuration.
Acknowledgements
----------------
Moire ScreenSaver was inspired by Pyro!¬ by Steve Brecher. I thought I could do it better╔
The Moire algorithm was taken from some code distributed via UseNet. Unfortunately the author of the code forgot to include his name, so if the moire code looks mighty familiar to you write to me and I will include your name in the next version. Thanks also to Stuart Burden and Graham Cottew for their help in testing the program. This program was written used LSC, and thus portions ⌐ THINK Technologies.
I reserve all rights to the portions of the program that were written exclusively by myself. This program may not be distributed for commercial gain but may otherwise be distributed freely. As I didn╒t write all the code in this program, I won╒t ask for any money for it. However I would be grateful if you sent me a small donation as a token of your appreciation for this screensaver.